using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

public class GameSpeedUI : MonoBehaviour
{

    [SerializeField] private Button speedOneButton;
    [SerializeField] private Button speedTwoButton;
    [SerializeField] private Button speedFourButton;
    // Start is called before the first frame update
    void Start()
    {
        speedOneButton.onClick.AddListener(() => OnClikeSpeedButton(1));
        speedTwoButton.onClick.AddListener(() => OnClikeSpeedButton(2));
        speedFourButton.onClick.AddListener(() => OnClikeSpeedButton(4));
        UpdateButtonClickedStatus(1);
    }

    private void OnClikeSpeedButton(int speed)
    {
        TestGameManager.Instance.ChangeDayTime(speed);
        UpdateButtonClickedStatus(speed);
    }

    private void UpdateButtonClickedStatus(int speed)
    {
        speedOneButton.interactable = speed != 1;
        speedTwoButton.interactable = speed != 2;
        speedFourButton.interactable = speed != 4;
    }

}
